#!/bin/sh
DATE=`date +%Y%m%d`
PKG="odpkg"
USR="--owner 1000 --group 1000 --same-permissions "
EXCLUDE=' --exclude "*~" --exclude .svn '
 
#chmod 660 etc/opendomo/profiles/*
#chgrp 1000 etc/opendomo/profiles/*
rm -f pkg/*.tar.gz
#echo "$DATE" > var/pkg/installed/$PKG
#chmod o-rwx ./sbin/pkg_*
#chown root ./sbin/pkg_*
chmod 0750 -R ./usr/local/opendomo/services/config/packages 
chmod 0750 ./usr/local/opendomo/services/syscript/*.sh

echo "Package manager" > pkg/$PKG.desc
echo "Add more features to OpenDomo from this module" >> pkg/$PKG.desc
echo "Repository manager" > pkg/${PKG}_rep.desc
cp pkg/*.desc ./var/pkg/

tar zvcf  pkg/$PKG-$DATE.od.noarch.tar.gz etc \
	usr/local/opendomo/services/config/packages/installPackage.sh \
	usr/local/opendomo/services/config/packages/updateInstalledPackages.sh \
	usr/local/opendomo/services/syscript/updatePackageList.sh \
	usr/local/opendomo/services/syscript var $USR $EXCLUDE
echo "" > pkg/$PKG.deps

#tar zcvf pkg/${PKG}_rep-$DATE.od.noarch.tar.gz usr/local/opendomo/services/config/packages/managePackageRepositories.sh $USR $EXCLUDE
exit 0

